// 文章相关的接口 article.js
import request from "@/util/http";



export const getInventoryById = (id) => {
  return request({
    url: `/api/inventory/${id}`,
    method: 'get',
    headers: {
      'Content-Type': 'application/json',
      'token': localStorage.getItem('token')
    },
  });
};

export const getInventory = () => {
    return request({
        url: '/api/inventory',
        method: 'get',
        headers: {
            'Content-Type': 'application/json',
            'token': localStorage.getItem('token')
        },
    });
};


export const addInventory = (data) => {
    return request({
        url: '/api/inventory',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/json',
            'token': localStorage.getItem('token')
        },
    });
};


export const updateInventory = (data) => {
    return request({
        url: `/api/inventory`,
        method: 'put',
        data,
        headers: {
            'Content-Type': 'application/json',
            'token': localStorage.getItem('token')
        },
    });
};


export const deleteInventory= (data) => {
    return request({
        url: `/api/inventory`,
        method: 'delete',
        data,
        headers: {
            'Content-Type': 'application/json',
            'token': localStorage.getItem('token')
        },
    });
};